import { defineConfig } from "@rspack/cli";
// const { rspack } = require("@rspack/core");
import webpack from "webpack";

export default defineConfig({
  mode: "development",
  devtool: "source-map",
  entry: "./bug.js",
  target: "web",
  output: {
    filename: "main.js",
    // iife: false,
    // library: {
    //   name: "falsy",
    //   type: "commonjs2",
    // },
  },

  plugins: [
    // new rspack.experiments.VirtualModulesPlugin({
    //   "foo.js": "module.exports = 'hello world'",
    // }),
    // process.env.WEBPACK &&
    new webpack.experiments.schemes.VirtualUrlPlugin({
      foo: "export default 'hello world'",
    }),
  ],
});
